Table of Contents
Installation and Usage
- Print Control - SpiritWeb
- Label Design - Designer
- Label Printing - SpiritLabel
- Registration Code Authorization
- Membership Authorization
Development Manual
- JS API
- Dynamic Link Library
- REST API
- Third-party Website Integration
- Android Native SDK
- H5 APP
FAQ
Integrating Label Editor into Third-Party Websites and Internal Information Systems
PrintSpirit provides a set of APIs to integrate Label Designer (SpiritDesigner) into third-party websites or internal information systems, offering comprehensive label editing and printing capabilities at minimal cost. Please refer to the PrintSpirit Open Platform.
For desktop application integration, use Dynamic Link Library API.
Requirements: Integrating PrintSpirit Label Editor requires an enterprise account (internet mode) or installed SpiritCenter (intranet mode). Both modes use identical development methods, differing only in server addresses:
- Internet mode uses official website: https://www.printspirit.cn
- Intranet mode uses SpiritCenter IP: http://[installation_IP]:9011 or https://[installation_IP]:9443
Experience
To experience third-party website integration effects, download Third-Party Website Simulator. This program establishes a simulated website locally, implementing label editing/printing through PrintSpirit's third-party APIs.
The program provides source code including Go and PHP examples for integration reference. See Simulated Third-Party Website Usage.
Download simulator (portable executable).
Run in Windows CLI (CMD/PowerShell):
1cd PATH/to/download_directory
2./third_site.exe -p 8000 -ip [SpiritCenter_IP]
- -p specifies web port (default:8000)
- -ip specifies SpiritCenter IP (omit for official website)
Access via http://127.0.0.1:8000 to view/manage labels.
Principles
PrintSpirit provides these APIs for enterprise/SpiritCenter users:
- /api/get-access-token Obtain access token (required for subsequent APIs, valid 1 hour)
- /api/new-label Create new label (blank/copy), returns ID for future operations
- /api/del-label Delete label
- /api/get-label-list Get label list
- /api/get-label-content Get label content
- /third-edit Launch label editor
Third-party systems can:
- Use
get-label-list
withsubclass
parameter for label categorization (ideal for SaaS user separation) - Display previews using
<img src="https://www.printspirit.cn/utils/thumb?id=tp_id"/>
(official) or<img src="http://IP:9011/utils/thumb?id=tp_id"/>
(SpiritCenter) - Edit labels by redirecting/embedding to
https://www.printspirit.cn/third-edit?token=__&subclass=__&tpid=__
Note: For internet mode, contact support to enable API after account registration. Use test account: third_test (password: third_test).
Development Tools
SDKs and examples:
- Go SDK: github.com/printspirit/gosdk
- Examples: github.com/printspirit/spirit_example (Go/PHP)
Go SDK
1go get github.com/printspirit/gosdk
Usage:
1site := gosdk.NewThirdApp(HOST_URL, UID, PASS)
2// API calls
Example Code
Clone repository:
1git clone https://github.com/printspirit/spirit_example
Go Version
1cd third_site/go
2go build
3./third_site.exe -p 8000 -ip [SpiritCenter_IP]
PHP Version
1cd third_site/php
2php -S localhost:8000 main.php
API Details
get-access-token
GET [host]/api/get-access-token?userid=UID&passwd=PWD
Response:
1{ "rc":"OK", "token":"...", "expirt":3600 }
new-label
GET [host]/api/new-label?token=...&subclass=...
Parameters:
- width/height: 0.1mm units
- dpi: dots/inch
- refid: template label ID (optional)
Response:
1{ "rc":"OK", "id": "3120f21d-e33c-41ed-8f99-3e259a12f6cd" }
del-label
GET [host]/api/del-label?token=...&id=LABEL_ID
get-label-list
GET [host]/api/get-label-list?token=...&subclass=...
Response:
1{ "rc":"OK", "data":[ {...} ] }
get-label-content
GET [host]/api/get-label-content?token=...&tpid=LABEL_ID
Response:
1{ "rc":"OK", "tpinfo":{...}, "data":[...] }
third-edit
Access URL: [host]/third-edit?token=...&subclass=...&tpid=...
Parameters:
- tpid: omit for new label